extern "C"
{
#include "string.h"
#include "trdp_mini.h"
#include "trdp_mini_types.h"
}
#include <iostream>

namespace trdp
{

typedef struct
{
	uint32_t comid;
	uint8_t *data;
	uint32_t size;
	uint32_t len;
} buffer_t;

int init(std::string local_ip, std::string multi_ip);

class pd_sub
{
  private:
	buffer_t *buffer;

  public:
	pd_sub(uint32_t com_id, uint32_t data_size);
	~pd_sub();
	uint32_t update(uint8_t *databuf, uint32_t bufsize);
};

class pd_pub
{
  private:
	buffer_t *buffer;

  public:
	pd_pub(uint32_t com_id, uint32_t data_size);
	~pd_pub();
	uint32_t update(uint8_t *databuf, uint32_t datasize);
};

} // namespace trdp